﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


using MomoCMS.Domain;
using MomoCMS.Domain.Models;
using MomoCMS.IDAO;


namespace MomoCMS.Service
{
    [Spring.Stereotype.Service]
    public class DocumentService :  IDocumentService  {

       public MomoCMS.IDAO.IDocumentDao DocumentDao { get; set; }

        public IList<Document> GetAll() {
            IList<Document> query = this.DocumentDao.GetAll();
            return query;
        }

        public void Save(DocumentModel model) {
            Document tempDoc = new Document();
            tempDoc.Body = model.Body;
            tempDoc.Title = model.Title;
            DocumentDao.Save(tempDoc);
        }
        

        public void Save(Document model) {
            DocumentDao.Save(model);
        }
        

       
    }
}
